package com.itheima.mapper;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /**
     * 查询用户是否存在
     */
    @Select("select * from user where phone=#{phone}")
    User selectUser(String phone);

    /**
     * 添加新用户到user表中
     */
    @Insert("insert into user values (#{id},#{phone},#{code},#{name},#{sex})")
    int addUser(User user);

}
